extends "../i_bangleh/i_bangleh.gd"

func init():
	.init()
	name = "火手镯·血"
	resetdata()
	info = "以血养火：<先手>为自己添加一层<火源>[cd:7秒]\n" + info 

func _connect():
	._connect()
	masCha.connect("onBattleStart",self,"ydgd")
	
func _upS():
	._upS()
	cnt2 += 1
	if cnt2 == 7:
		cnt2 = 0
		ydgd()

func ydgd():
	masCha.addBuff(HY.new(1))
	masCha.addBuff(MYH.new(1))

class HY:
	extends Buff
	var canremove:bool = false
	func _init(lv):
		attInit()
		id = "HY"
		life = lv * 4
	func _upS():
		._upS()
		if masCha.att.hp / masCha.att.maxHp < 0.02:
			masCha.plusHp(- masCha.att.hp + 1)
		else:
			masCha.plusHp(-masCha.att.maxHp * 0.02)